#include "addgroupmemberdialog.h"
#include "ui_addgroupmemberdialog.h"

#include <QMessageBox>

AddGroupMemberDialog::AddGroupMemberDialog(GroupDetailDialog *p, QWidget *parent) :
    QDialog(parent),
    ui(new Ui::AddGroupMemberDialog)
{
    ui->setupUi(this);
    this->parent = p;
}

AddGroupMemberDialog::~AddGroupMemberDialog()
{
    delete ui;
}

void AddGroupMemberDialog::on_btn_add_clicked()
{
    if(!this->parent->add_member(ui->input_uid->text())) {
        QMessageBox::information(this, tr("Error"), tr("添加失败，无此id或组内已有该成员"), QMessageBox::Yes);
    }
    QMessageBox::information(this, tr("Success"), tr("添加成功"), QMessageBox::Yes);
    this->close();
}
